// 引入axios
import axios from 'axios'
// 设置基准路径
axios.defaults.baseURL = 'http://127.0.0.1:3000'
// 请求携带cookie
axios.defaults.withCredentials = true
// 登录请求
export const login = obj => axios.post('/employee/employeeLogin', obj)
// 判断是否登陆
export const rootLogin = () => axios.get('/employee/checkRootLogin')
// 登出请求
export const logout = () => axios.get('/employee/employeeLogout')
// 用户查询
export const queryUser = obj => axios.get('/user/queryUser', { params: obj })
// 禁用用户
export const updateUser = obj => axios.post('/user/updateUser', obj)
// 商品详情
export const goodDetail = obj => axios.get('/product/queryProductDetailList', { params: obj })
// 一级分类查询
export const firstCate = obj => axios.get('/category/queryTopCategoryPaging', { params: obj })
// 二级分类查询
export const SecondCate = obj => axios.get('/category/querySecondCategoryPaging', { params: obj })
// 添加商品
export const addGood = obj => axios.post('/product/addProduct', obj)
// 添加一级分类
export const addCateFirst = categoryName => axios.post('/category/addTopCategory', { categoryName })
// 添加二级分类
export const addCateSecond = obj => axios.post('/category/addSecondCategory', obj)
// // 商品图片
// export const addGoodPic = obj => axios.post('/product/addProductPic', obj)
